package com.neusoft.chenhanhua.d0922;

public class Threadq {
	public static void main(String[] args) {
		//t1();
		//t2();
		//t3();
		t4();
	}
	public static void t1() {
		//线程方法一
		Thread2 th2=new Thread2();
		th2.setName("thrad");
		th2.start();
		//线程方法二
		Thread1 th1= new Thread1();
		//依然是依赖thread来启动的
		Thread tq=new Thread(th1,"Runnable");
		tq.start();
	}
	public static void t2() {
		Runnable r=new Tonbu();
		Thread t1=new Thread(r,"窗口一");
		t1.start();
		Thread t2=new Thread(r,"窗口二");
		t2.start();
		Thread t3=new Thread(r,"窗口三");
		t3.start();
	}
	public static void t3() {
		TonbuThread tbt=new TonbuThread();
		tbt.setName("窗口一");
		tbt.start();
		TonbuThread tbt2=new TonbuThread();
		tbt2.setName("窗口二");
		tbt2.start();
		TonbuThread tbt3=new TonbuThread();
		tbt3.setName("窗口三");
		tbt3.start();
	}
	//4.使用两个线程打印 1-100. 线程1, 线程2 交替打印
	public static void t4() {
		Runnable daq=new Cfudaying();
		Thread t1=new Thread(daq,"第1");
		t1.start();
		Thread t2=new Thread(daq,"第二");
		t2.start();
	}

}
